﻿<Window x:Class="EpubManga.PreviewWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:manga="clr-namespace:EpubManga"
        Title="PreviewWindow" Height="1000" Width="1200" MinWidth="800" WindowStartupLocation="CenterScreen" Background="LightYellow">

    <Window.Resources>
        <ResourceDictionary Source="./Styles/Style.xaml"/>
    </Window.Resources>
    
    <Grid>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Grid Grid.Row="0">
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="20"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Image Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"
                Height="{Binding Image1.Height, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
                Width="{Binding Image1.Width, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
                Source="{Binding Image1, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"/>

            <Image Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"
                Height="{Binding Image2.Height, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
                Width="{Binding Image2.Width, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
                Source="{Binding Image2, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"/>

        </Grid>
        
        <TextBlock Grid.Row="0" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"
            Visibility="{Binding ShowError, Converter={StaticResource BoolToVisibilityConv}, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
            Text="{Binding Error, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"/>

        <Grid Grid.Row="1">
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="800"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Grid Grid.Row="0" Grid.Column="1">
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                
                <Button Grid.Column="0" Style="{StaticResource ImageButton}" ToolTip="First Image" Content="&lt;&lt;"
                    Command="{Binding FirstCommand}"/>

                <Button Grid.Column="1" Style="{StaticResource ImageButton}" ToolTip="Previous Image" Content="&lt;"
                    Command="{Binding PreviousCommand}"/>

                <TextBlock Grid.Column="3" FontWeight="Bold"
                    Text="{Binding ImagePath, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"/>

                <Button Grid.Column="5" Style="{StaticResource ImageButton}" ToolTip="Next Image" Content="&gt;"
                    Command="{Binding NextCommand}"/>

                <Button Grid.Column="6" Style="{StaticResource ImageButton}" ToolTip="Last Image" Content="&gt;&gt;"
                    Command="{Binding LastCommand}"/>

            </Grid>

            <GroupBox Grid.Row="1" Grid.Column="1" Header="Options">
                <manga:Options/>
            </GroupBox>
            
        </Grid>
        
    </Grid>
    
</Window>
